package service;

import model.User;

import java.sql.SQLException;
import java.util.List;


public interface UserService {

  /**
   * 根据id查找用户
   * @param id
   * @return User
   * @throws SQLException
   */
  public User findUserById(int id)throws SQLException;

  /**
   * 用户信息更新
   * @param user
   * @return boolean
   */
  public boolean updateUser(User user);

  /**
   * 通过电话号码查询用户
   * @param phone
   * @return User
   * @throws SQLException
   */
  public User findUserByPhone(String phone) throws SQLException;
  /**
   * 通过邮箱号码查询用户
   * @param email
   * @return User
   * @throws SQLException
   */
  public User findUserByEmail(String email) throws SQLException;

  /**
   * 用户添加
   * @param user
   * @return boolean
   */
  public boolean add(User user);

  /**
   * 查询所有用户
   * @return List<User>
   */
  public List<User> findAllUser();

  /**
   * 删除用户
   * @param id
   * @return boolean
   */
  public boolean delById(Integer id);


}
